<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
	  xmlns:layout="http://www.thymeleaf.org/extras/dialect"
	  layout:decorate="layout/layout_login"
>
<head>
	<title>登录</title>
	<meta charset="utf-8"/>
	<link rel="stylesheet" href="../../static/asset/css/base.min.css" th:href="@{/asset/css/base.min.css}"/>
	<link rel="stylesheet" href="../../static/asset/css/common/front.css" th:href="@{/asset/css/common/front.css}"/>
	<link rel="stylesheet" href="../../static/asset/css/back/login.css" th:href="@{/asset/css/back/login.css}"/>
</head>
<body>
<div layout:fragment="content" class="wrapper login-wrapper">
	<div class="login-container ">
		 <div id="tree"></div>
	</div>
</div>

<th:block layout:fragment="script">
	<script type="text/javascript" src="../../static/asset/js/base.min.js" th:src="@{/asset/js/base.min.js}"></script>
	<script type="text/javascript" src="../../static/asset/js/app.js" th:src="@{/asset/js/app.js}"></script>

	<script>

        $(function () {

            $.ajax({
                type: 'POST',
                url: './admin/client/scopetree',
                success: function(data, textStatus, jqXHR){
                    $('#tree').treeview({
                        data: data,
                        showIcon: false,
                        showCheckbox: true,
                        levels: 4,
                        multiSelect: true
                    }).on('nodeSelected', function(event, data) {
                        console.log("nodeSelected-----" + data.value);
                    }).on('nodeChecked', function(event, data) {
                        console.log("nodeChecked-----" + data.value);
                    }).on('nodeCollapsed', function(event, data) {
                        console.log("nodeCollapsed-----" + data.value);
                    }).on('nodeDisabled', function(event, data) {
                        console.log("nodeDisabled-----" + data.value);
                    }).on('nodeEnabled', function(event, data) {
                        console.log("nodeEnabled-----" + data.value);
                    }).on('nodeExpanded', function(event, data) {
                        console.log("nodeExpanded-----" + data.value);
                    }).on('nodeSelected', function(event, data) {
                        console.log("nodeSelected-----" + data.value);
                    }).on('nodeUnchecked', function(event, data) {
                        console.log("nodeUnchecked-----" + data.value);
                    }).on('nodeUnselected', function(event, data) {
                        console.log("nodeUnselected-----" + data.value);
                    });
				}
            });

        })
	</script>

</th:block>
</body>
</html>
